package com.cn.utils;

import java.util.HashMap;
import java.util.Map;

import com.cn.domain.User;

public class UserUtils {

	public static Map<String, String> checkUser(User u){
		Map<String,String> errors = new HashMap<String,String>();
		
		if(u.getUsername()==null||"".equals(u.getUsername())){
			 errors.put("username", "用户名不能为空！");
		}
		if(u.getPassword()==null||"".equals(u.getPassword())){
			errors.put("password", "密码不能为空！");
		}
		return errors;
	}
//	public static User autoWire(ResultSet rs) throws SQLException {
//		User u = new User();
//		 u.setId(rs.getInt("id"));
//		 u.setUsername(rs.getString("username"));
//		 u.setPassword(rs.getString("password"));
//		 u.setGender(rs.getString("gender"));
//		 u.setEmail(rs.getString("email"));
//		 u.setTelephone(rs.getString("telephone"));
//		 u.setRegistTime(rs.getDate("registTime"));
//		return u;
//	}
}
